Skip to content

Add switch to MQTT discovery#6733

Merged
fabaff merged 1 commit into
home-assistant:devfrom
fabaff:mqtt-discovery-switch
Mar 26, 2017
Merged

Add switch to MQTT discovery#6733
fabaff merged 1 commit into
home-assistant:devfrom
fabaff:mqtt-discovery-switch

Conversation

@fabaff
Copy link
Copy Markdown
Member

@fabaff fabaff commented Mar 21, 2017

Description:

Enables the discovery of MQTT switches.

Setting up a switch.

$ mosquitto_pub -h 127.0.0.1 -p 1883 -t "homeassistant/switch/irrigation/config" \
  -m '{"name": "garden", "command_topic": "homeassistant/switch/irrigation/set"}'

Set the state.

$ mosquitto_pub -h 127.0.0.1 -p 1883 -t "homeassistant/switch/irrigation/set" -m ON

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#2312

Example entry for configuration.yaml (if applicable):

mqtt:
  discovery: true

Checklist:

If user exposed functionality or configuration variables are added/changed:

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass

@mention-bot
Copy link
Copy Markdown

@fabaff, thanks for your PR! By analyzing the history of the files in this pull request, we identified @sfam, @pvizeli and @balloob to be potential reviewers.

@robbiet480
Copy link
Copy Markdown
Contributor

We might as well just add every component that has an MQTT platform to MQTT discovery, no?

@fabaff
Copy link
Copy Markdown
Member Author

fabaff commented Mar 21, 2017

We could do that. Doing it one by one allows me to do at least some basic testing.

@fabaff fabaff closed this Mar 24, 2017
@fabaff fabaff reopened this Mar 24, 2017
@fabaff fabaff merged commit 22b28d8 into home-assistant:dev Mar 26, 2017
@fabaff fabaff deleted the mqtt-discovery-switch branch March 26, 2017 13:48
@fabaff fabaff mentioned this pull request Apr 6, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Jul 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants